<div class="venueDetails">
    <input type="hidden" name="getVenueId" id="selectedVenueId">
    <input type="hidden" name="getCountry" id="getCountryId">   
    <?php
    $selectedvanue = '';
    for ($venueIndex = 0; $venueIndex < count($venuesWithClass); $venueIndex++) {
        $model = $this->loadModel($venuesWithClass[$venueIndex]->class_venue_id, 'ClassVenue');
        $venueWithBatch = $modelClassBatch->findAllByAttributes(array('class_venue_id' => $venuesWithClass[$venueIndex]->class_venue_id, 'classes_id' => $venuesWithClass[$venueIndex]->classes_id));
        $selectedvanue.=$venuesWithClass[$venueIndex]->class_venue_id . ',';
        /* .............................. this code use for all venues  start ............................... */
        ?>
        <div id="venue_count_<?php echo$venueIndex; ?>" class="venue_class_show_hide_<?php echo $venueIndex; ?> venueContent" style="<?php echo ($venueIndex != 0) ? 'display:none;' : ';'; ?>">
            <div class="row">
                <div class="col-lg-4 col-md-4 col-sm-4 column4">
                    <input type="hidden" name="venueIndex[]" value="<?php echo $venueIndex; ?>">
                    <label for="class_venue_venueid_">Select Venue</label>
                    <?php echo CHtml::dropDownList('ClassVenue[venueId][]', $venuesWithClass[$venueIndex]->class_venue_id, getVenueByUser($model), array("empty" => "Select venue", 'class' => 'form-control book-control selectedVenue selectedVenue', 'onchange' => 'getVanueDeatils(this.id);', 'id' => 'class_venue_venueid_' . $venueIndex)); ?>
                    <span class="class-arrow1"></span>
                    <p id="error_class_venue_venueid_<?php echo$venueIndex; ?>" class="errorMessage" style="display:none">You have already selected this venue. So please select another venue!</p>
                </div>
                <div class="col-lg-8 col-md-8 col-sm-8 course-pdr column8">
                    <?php echo $form->labelEx($model, 'name'); ?>
                    <input maxlength="45" id="class_venue_name_<?php echo $venueIndex; ?>" class="requiredfield  form-control book-control" onblur="checkValueEmpty(this.id)" name="ClassVenue[name][]" type="text" value="<?php echo $model->name; ?>"> 
                    <div class="errorMessage" id="error_class_venue_name_<?php echo $venueIndex; ?>" style="display:none">Name cannot be blank.</div>
                </div>
            </div>
            <div class="col-lg-12 col-md-12 column12 course-pdr">
                <?php echo $form->labelEx($model, 'address_line1'); ?>
                <input maxlength="45" id="class_venue_address_line1_<?php echo $venueIndex; ?>" class="requiredfield form-control book-control" onblur="checkValueEmpty(this.id)" name="ClassVenue[address_line1][]" type="text" value="<?php echo $model->address_line1; ?>">
                <div class="errorMessage" id="error_class_venue_address_line1_<?php echo $venueIndex; ?>" style="display:none">Address Line 1 cannot be blank.</div>
            </div>
            <div class="col-lg-12 col-md-12 column12 course-pdr">
                <?php echo $form->labelEx($model, 'address_line2'); ?>
                <input maxlength="45" id="class_venue_address_line2_<?php echo $venueIndex; ?>" class="form-control book-control" onblur="checkValueEmpty(this.id)" name="ClassVenue[address_line2][]" type="text" value="<?php echo $model->address_line2; ?>">
                <div class="errorMessage" id="error_class_venue_address_line2_<?php echo $venueIndex; ?>" style="display:none">Address Line 1 cannot be blank.</div>
            </div>
            <div class="col-lg-12 col-md-12 column12 course-pdr">
                <?php echo $form->labelEx($model, 'venue_locality'); ?>
                <input maxlength="45" id="class_venue_venue_locality_<?php echo $venueIndex; ?>" class="requiredfield form-control book-control" onblur="checkValueEmpty(this.id)" name="ClassVenue[venue_locality][]" type="text" value="<?php echo $model->venue_locality; ?>" onkeyup ="getLocality(this.id)" onpaste="return false;">
                <div class="errorMessage" id="error_class_venue_venue_locality_<?php echo $venueIndex; ?>" style="display:none">Locality cannot be blank.</div>
                <div class="errorMessage" id="error_local_class_venue_venue_locality_<?php echo $venueIndex; ?>"></div>
                <div class="note" > Note:<?php echo Message::LOCALITY_HELP; ?></div>
            </div> 
            <div class="clearfix">
            <div class="col-lg-4 col-md-4 col-sm-4 column4 ">
                <?php echo $form->labelEx($model, 'zip_code'); ?>
                <input maxlength="6" id="class_venue_zip_code_<?php echo $venueIndex; ?>" class="form-control book-control requiredfield" onblur="checkValueEmpty(this.id)" name="ClassVenue[zip_code][]" type="text" value="<?php echo $model->zip_code; ?>">   
                <div class="errorMessage" id="error_class_venue_zip_code_<?php echo $venueIndex; ?>" style="display:none">Zip Code cannot be blank.</div>
            </div>
            <div class="col-lg-8 col-md-8 col-sm-8 course-pdr column8">
                <?php echo $form->labelEx($model, 'country_id'); ?>
                <?php echo CHtml::dropDownList('ClassVenue[country_id][]', $model->country_id, GxHtml::listData(Country::model()->findAllByAttributes(array('is_active' => SkillConfig::STATUS_ACTIVE, 'id' => SkillConfig::ACTIVE_COUNTRY)), 'id', 'name'), array('class' => 'form-control book-control', 'id' => 'class_venue_country_id_' . $venueIndex, 'onchange' => 'getSelectedState(this.id)')); ?>
                <span class="class-arrow1"></span>
                <div class="errorMessage" id="error_class_venue_country_id_<?php echo $venueIndex; ?>" style="display:none">Country Name cannot be blank.</div>
            </div> 
            </div>
              <div class="clearfix">
            <div class="col-lg-4 col-md-4 col-sm-4 column4">
                <?php echo $form->labelEx($model, 'state_id'); ?>
                <?php echo CHtml::dropDownList('ClassVenue[state_id][]', $model->state_id, GxHtml::listData(State::model()->findAllByAttributes(array('is_active' => SkillConfig::STATUS_ACTIVE, 'id' => SkillConfig::ACTIVE_STATE)), 'id', 'name'), array('class' => 'form-control book-control', 'id' => 'class_venue_state_id_' . $venueIndex, 'onchange' => 'getSelectedCity(this.id)')); ?>
                <span class="class-arrow1"></span>
                <div class="errorMessage" id="error_class_venue_state_id_<?php echo $venueIndex; ?>" style="display:none">State Name cannot be blank.</div>
            </div>
            <div class="col-lg-8 col-md-8 col-sm-8 course-pdr column8">
                <?php echo $form->labelEx($model, 'city_id'); ?>
                <?php echo CHtml::dropDownList('ClassVenue[city_id][]', $model->city_id, GxHtml::listData(City::model()->findAllByAttributes(array('status' => SkillConfig::STATUS_ACTIVE)), 'id', 'city_name'), array('class' => 'form-control book-control', 'id' => 'class_venue_city_id_' . $venueIndex)); ?>
                <span class="class-arrow1"></span>
                <div class="errorMessage" id="error_class_venue_city_id_<?php echo $venueIndex; ?>" style="display:none">City Name cannot be blank.</div>
            </div> </div>

            <!-- Readjustment Of Menus -->
            <div class="row">
                <div class="clearfix"></div>
                <?php
                /* .............................. this code use for all venues  end  ............................... */
                /* .......................         Here is the batch code start................ */
                ?>
                <div class ="addbatch_venue_<?php echo $venueIndex; ?>_batch">
                    <?php
                    for ($batchIndex = 0; $batchIndex < count($venueWithBatch); $batchIndex++) {
                        $this->renderPartial('/classBatch/_classbatchUpdate', array('form' => $form, 'model' => $modelClassBatch,
                            'batchIndex' => $batchIndex, 'venueIndex' => $venueIndex, 'venueWithBatch' => $venueWithBatch));
                    }
                    ?>
                </div> 
                <?php /* .......................         Here is the batch code end................ */ ?>

            </div><!--batch main row end here-->

            <!-- Readjustment of Menus -->
            <!-- ADD A BATCH AND ADD AVENUE STARTS HERE -->
            <div class="row batch-row adding-el">
                <div class="col-lg-12 column12 course-pdr">
                    <a href="javascript:void(0)"  id="venue_<?php echo $venueIndex; ?>_batch_<?php echo ($batchIndex == '') ? '0' : $batchIndex - 1; ?>" onclick="addBatch(this.id);">Add Batch</a>

                </div>
            </div> 
            <?php if ($venueIndex != 0) { ?>
                <div class="row batch-row adding-el">
                    <div class="col-lg-12 column12 course-pdr">
                        <a href="javascript:void(0)"  id="venue_remove_<?php echo $venueIndex; ?>" onclick="reMoveVenue(this.id);">Remove Venue</a>

                    </div>
                </div>  <?php } ?>
        </div>
    <?php }
    ?>
    <div class="clearfix"></div>
    <input type="hidden" id="getAllselectVenueVal" value="<?php echo $selectedvanue; ?>">
</div>

